﻿@model IEnumerable<CinemaCommon.Entities.Movie>

@{
    ViewBag.Title = "Movies";
}

<h2>Movies</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Price)
            </th>
            <th></th>
        </tr>
    </thead>

    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @item.Price.ToString("0.#0 €")
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.MovieId }) |
                @Html.ActionLink("Details", "Details", new { id = item.MovieId }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.MovieId })
                </td>
            </tr>
        }
    </tbody>

</table>
